<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html lang="en">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>LCOV - code analysis - /usr/include/boost/range/algorithm/equal.hpp</title>
  <link rel="stylesheet" type="text/css" href="../../../../../gcov.css">
</head>

<body>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="title">LCOV - code coverage report</td></tr>
    <tr><td class="ruler"><img src="../../../../../glass.png" width=3 height=3 alt=""></td></tr>

    <tr>
      <td width="100%">
        <table cellpadding=1 border=0 width="100%">
          <tr>
            <td width="10%" class="headerItem">Current view:</td>
            <td width="35%" class="headerValue"><a href="../../../../../index.html">top level</a> - <a href="index.html">usr/include/boost/range/algorithm</a> - equal.hpp<span style="font-size: 80%;"> (source / <a href="equal.hpp.func-sort-c.html">functions</a>)</span></td>
            <td width="5%"></td>
            <td width="15%"></td>
            <td width="10%" class="headerCovTableHead">Hit</td>
            <td width="10%" class="headerCovTableHead">Total</td>
            <td width="15%" class="headerCovTableHead">Coverage</td>
          </tr>
          <tr>
            <td class="headerItem">Test:</td>
            <td class="headerValue">code analysis</td>
            <td></td>
            <td class="headerItem">Lines:</td>
            <td class="headerCovTableEntry">0</td>
            <td class="headerCovTableEntry">5</td>
            <td class="headerCovTableEntryLo">0.0 %</td>
          </tr>
          <tr>
            <td class="headerItem">Date:</td>
            <td class="headerValue">2020-09-11 22:50:33</td>
            <td></td>
            <td class="headerItem">Functions:</td>
            <td class="headerCovTableEntry">0</td>
            <td class="headerCovTableEntry">4</td>
            <td class="headerCovTableEntryLo">0.0 %</td>
          </tr>
          <tr>
            <td class="headerItem">Legend:</td>
            <td class="headerValueLeg">            Lines:
            <span class="coverLegendCov">hit</span>
            <span class="coverLegendNoCov">not hit</span>
</td>
            <td></td>
          </tr>
          <tr><td><img src="../../../../../glass.png" width=3 height=3 alt=""></td></tr>
        </table>
      </td>
    </tr>

    <tr><td class="ruler"><img src="../../../../../glass.png" width=3 height=3 alt=""></td></tr>
  </table>

  <table cellpadding=0 cellspacing=0 border=0>
    <tr>
      <td><br></td>
    </tr>
    <tr>
      <td>
<pre class="sourceHeading">          Line data    Source code</pre>
<pre class="source">
<a name="1"><span class="lineNum">       1 </span>            : // Boost.Range library</a>
<span class="lineNum">       2 </span>            : //
<span class="lineNum">       3 </span>            : //  Copyright Neil Groves 2009.
<span class="lineNum">       4 </span>            : //  Use, modification and distribution is subject to the Boost Software
<span class="lineNum">       5 </span>            : //  License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
<span class="lineNum">       6 </span>            : //  http://www.boost.org/LICENSE_1_0.txt)
<span class="lineNum">       7 </span>            : //
<span class="lineNum">       8 </span>            : // For more information, see http://www.boost.org/libs/range/
<span class="lineNum">       9 </span>            : //
<span class="lineNum">      10 </span>            : #ifndef BOOST_RANGE_ALGORITHM_EQUAL_HPP_INCLUDED
<span class="lineNum">      11 </span>            : #define BOOST_RANGE_ALGORITHM_EQUAL_HPP_INCLUDED
<span class="lineNum">      12 </span>            : 
<span class="lineNum">      13 </span>            : #include &lt;boost/config.hpp&gt;
<span class="lineNum">      14 </span>            : #include &lt;boost/range/concepts.hpp&gt;
<span class="lineNum">      15 </span>            : #include &lt;iterator&gt;
<span class="lineNum">      16 </span>            : 
<span class="lineNum">      17 </span>            : namespace boost
<span class="lineNum">      18 </span>            : {
<span class="lineNum">      19 </span>            :     namespace range_detail
<span class="lineNum">      20 </span>            :     {
<span class="lineNum">      21 </span>            :         // An implementation of equality comparison that is optimized for iterator
<span class="lineNum">      22 </span>            :         // traversal categories less than RandomAccessTraversal.
<span class="lineNum">      23 </span>            :         template&lt; class SinglePassTraversalReadableIterator1,
<span class="lineNum">      24 </span>            :                   class SinglePassTraversalReadableIterator2,
<span class="lineNum">      25 </span>            :                   class IteratorCategoryTag1,
<span class="lineNum">      26 </span>            :                   class IteratorCategoryTag2 &gt;
<span class="lineNum">      27 </span>            :         inline bool equal_impl( SinglePassTraversalReadableIterator1 first1,
<span class="lineNum">      28 </span>            :                                 SinglePassTraversalReadableIterator1 last1,
<span class="lineNum">      29 </span>            :                                 SinglePassTraversalReadableIterator2 first2,
<span class="lineNum">      30 </span>            :                                 SinglePassTraversalReadableIterator2 last2,
<span class="lineNum">      31 </span>            :                                 IteratorCategoryTag1,
<span class="lineNum">      32 </span>            :                                 IteratorCategoryTag2 )
<span class="lineNum">      33 </span>            :         {
<span class="lineNum">      34 </span>            :             for (;;)
<span class="lineNum">      35 </span>            :             {
<span class="lineNum">      36 </span>            :                 // If we have reached the end of the left range then this is
<span class="lineNum">      37 </span>            :                 // the end of the loop. They are equal if and only if we have
<span class="lineNum">      38 </span>            :                 // simultaneously reached the end of the right range.
<span class="lineNum">      39 </span>            :                 if (first1 == last1)
<span class="lineNum">      40 </span>            :                     return first2 == last2;
<span class="lineNum">      41 </span>            : 
<span class="lineNum">      42 </span>            :                 // If we have reached the end of the right range at this line
<span class="lineNum">      43 </span>            :                 // it indicates that the right range is shorter than the left
<span class="lineNum">      44 </span>            :                 // and hence the result is false.
<span class="lineNum">      45 </span>            :                 if (first2 == last2)
<span class="lineNum">      46 </span>            :                     return false;
<span class="lineNum">      47 </span>            : 
<span class="lineNum">      48 </span>            :                 // continue looping if and only if the values are equal
<span class="lineNum">      49 </span>            :                 if (*first1 != *first2)
<span class="lineNum">      50 </span>            :                     break;
<span class="lineNum">      51 </span>            : 
<span class="lineNum">      52 </span>            :                 ++first1;
<span class="lineNum">      53 </span>            :                 ++first2;
<span class="lineNum">      54 </span>            :             }
<span class="lineNum">      55 </span>            : 
<span class="lineNum">      56 </span>            :             // Reaching this line in the algorithm indicates that a value
<span class="lineNum">      57 </span>            :             // inequality has been detected.
<span class="lineNum">      58 </span>            :             return false;
<span class="lineNum">      59 </span>            :         }
<span class="lineNum">      60 </span>            : 
<span class="lineNum">      61 </span>            :         template&lt; class SinglePassTraversalReadableIterator1,
<span class="lineNum">      62 </span>            :                   class SinglePassTraversalReadableIterator2,
<span class="lineNum">      63 </span>            :                   class IteratorCategoryTag1,
<span class="lineNum">      64 </span>            :                   class IteratorCategoryTag2,
<span class="lineNum">      65 </span>            :                   class BinaryPredicate &gt;
<span class="lineNum">      66 </span>            :         inline bool equal_impl( SinglePassTraversalReadableIterator1 first1,
<span class="lineNum">      67 </span>            :                                 SinglePassTraversalReadableIterator1 last1,
<span class="lineNum">      68 </span>            :                                 SinglePassTraversalReadableIterator2 first2,
<span class="lineNum">      69 </span>            :                                 SinglePassTraversalReadableIterator2 last2,
<span class="lineNum">      70 </span>            :                                 BinaryPredicate                      pred,
<span class="lineNum">      71 </span>            :                                 IteratorCategoryTag1,
<span class="lineNum">      72 </span>            :                                 IteratorCategoryTag2 )
<span class="lineNum">      73 </span>            :         {
<span class="lineNum">      74 </span>            :             for (;;)
<span class="lineNum">      75 </span>            :             {
<span class="lineNum">      76 </span>            :                 // If we have reached the end of the left range then this is
<span class="lineNum">      77 </span>            :                 // the end of the loop. They are equal if and only if we have
<span class="lineNum">      78 </span>            :                 // simultaneously reached the end of the right range.
<span class="lineNum">      79 </span>            :                 if (first1 == last1)
<span class="lineNum">      80 </span>            :                     return first2 == last2;
<span class="lineNum">      81 </span>            : 
<span class="lineNum">      82 </span>            :                 // If we have reached the end of the right range at this line
<span class="lineNum">      83 </span>            :                 // it indicates that the right range is shorter than the left
<span class="lineNum">      84 </span>            :                 // and hence the result is false.
<span class="lineNum">      85 </span>            :                 if (first2 == last2)
<span class="lineNum">      86 </span>            :                     return false;
<span class="lineNum">      87 </span>            : 
<span class="lineNum">      88 </span>            :                 // continue looping if and only if the values are equal
<span class="lineNum">      89 </span>            :                 if (!pred(*first1, *first2))
<span class="lineNum">      90 </span>            :                     break;
<span class="lineNum">      91 </span>            : 
<span class="lineNum">      92 </span>            :                 ++first1;
<span class="lineNum">      93 </span>            :                 ++first2;
<span class="lineNum">      94 </span>            :             }
<span class="lineNum">      95 </span>            : 
<span class="lineNum">      96 </span>            :             // Reaching this line in the algorithm indicates that a value
<span class="lineNum">      97 </span>            :             // inequality has been detected.
<span class="lineNum">      98 </span>            :             return false;
<span class="lineNum">      99 </span>            :         }
<span class="lineNum">     100 </span>            : 
<span class="lineNum">     101 </span>            :         // An implementation of equality comparison that is optimized for
<span class="lineNum">     102 </span>            :         // random access iterators.
<a name="103"><span class="lineNum">     103 </span>            :         template&lt; class RandomAccessTraversalReadableIterator1,</a>
<span class="lineNum">     104 </span>            :                   class RandomAccessTraversalReadableIterator2 &gt;
<span class="lineNum">     105 </span><span class="lineNoCov">          0 :         inline bool equal_impl( RandomAccessTraversalReadableIterator1 first1,</span>
<span class="lineNum">     106 </span>            :                                 RandomAccessTraversalReadableIterator1 last1,
<span class="lineNum">     107 </span>            :                                 RandomAccessTraversalReadableIterator2 first2,
<span class="lineNum">     108 </span>            :                                 RandomAccessTraversalReadableIterator2 last2,
<span class="lineNum">     109 </span>            :                                 std::random_access_iterator_tag,
<span class="lineNum">     110 </span>            :                                 std::random_access_iterator_tag )
<span class="lineNum">     111 </span>            :         {
<span class="lineNum">     112 </span>            :             return ((last1 - first1) == (last2 - first2))
<span class="lineNum">     113 </span><span class="lineNoCov">          0 :                 &amp;&amp; std::equal(first1, last1, first2);</span>
<span class="lineNum">     114 </span>            :         }
<span class="lineNum">     115 </span>            : 
<span class="lineNum">     116 </span>            :         template&lt; class RandomAccessTraversalReadableIterator1,
<span class="lineNum">     117 </span>            :                   class RandomAccessTraversalReadableIterator2,
<span class="lineNum">     118 </span>            :                   class BinaryPredicate &gt;
<span class="lineNum">     119 </span>            :         inline bool equal_impl( RandomAccessTraversalReadableIterator1 first1,
<span class="lineNum">     120 </span>            :                                 RandomAccessTraversalReadableIterator1 last1,
<span class="lineNum">     121 </span>            :                                 RandomAccessTraversalReadableIterator2 first2,
<span class="lineNum">     122 </span>            :                                 RandomAccessTraversalReadableIterator2 last2,
<span class="lineNum">     123 </span>            :                                 BinaryPredicate                        pred,
<span class="lineNum">     124 </span>            :                                 std::random_access_iterator_tag,
<span class="lineNum">     125 </span>            :                                 std::random_access_iterator_tag )
<span class="lineNum">     126 </span>            :         {
<span class="lineNum">     127 </span>            :             return ((last1 - first1) == (last2 - first2))
<span class="lineNum">     128 </span>            :                 &amp;&amp; std::equal(first1, last1, first2, pred);
<span class="lineNum">     129 </span>            :         }
<span class="lineNum">     130 </span>            : 
<span class="lineNum">     131 </span>            :         template&lt; class SinglePassTraversalReadableIterator1,
<span class="lineNum">     132 </span>            :                   class SinglePassTraversalReadableIterator2 &gt;
<span class="lineNum">     133 </span>            :         inline bool equal( SinglePassTraversalReadableIterator1 first1,
<span class="lineNum">     134 </span>            :                            SinglePassTraversalReadableIterator1 last1,
<span class="lineNum">     135 </span>            :                            SinglePassTraversalReadableIterator2 first2,
<span class="lineNum">     136 </span>            :                            SinglePassTraversalReadableIterator2 last2 )
<span class="lineNum">     137 </span>            :         {
<span class="lineNum">     138 </span>            :             BOOST_DEDUCED_TYPENAME std::iterator_traits&lt; SinglePassTraversalReadableIterator1 &gt;::iterator_category tag1;
<span class="lineNum">     139 </span>            :             BOOST_DEDUCED_TYPENAME std::iterator_traits&lt; SinglePassTraversalReadableIterator2 &gt;::iterator_category tag2;
<span class="lineNum">     140 </span>            : 
<span class="lineNum">     141 </span><span class="lineNoCov">          0 :             return equal_impl(first1, last1, first2, last2, tag1, tag2);</span>
<span class="lineNum">     142 </span>            :         }
<span class="lineNum">     143 </span>            : 
<span class="lineNum">     144 </span>            :         template&lt; class SinglePassTraversalReadableIterator1,
<span class="lineNum">     145 </span>            :                   class SinglePassTraversalReadableIterator2,
<span class="lineNum">     146 </span>            :                   class BinaryPredicate &gt;
<span class="lineNum">     147 </span>            :         inline bool equal( SinglePassTraversalReadableIterator1 first1,
<span class="lineNum">     148 </span>            :                            SinglePassTraversalReadableIterator1 last1,
<span class="lineNum">     149 </span>            :                            SinglePassTraversalReadableIterator2 first2,
<span class="lineNum">     150 </span>            :                            SinglePassTraversalReadableIterator2 last2,
<span class="lineNum">     151 </span>            :                            BinaryPredicate                      pred )
<span class="lineNum">     152 </span>            :         {
<span class="lineNum">     153 </span>            :             BOOST_DEDUCED_TYPENAME std::iterator_traits&lt; SinglePassTraversalReadableIterator1 &gt;::iterator_category tag1;
<span class="lineNum">     154 </span>            :             BOOST_DEDUCED_TYPENAME std::iterator_traits&lt; SinglePassTraversalReadableIterator2 &gt;::iterator_category tag2;
<span class="lineNum">     155 </span>            : 
<span class="lineNum">     156 </span>            :             return equal_impl(first1, last1, first2, last2, pred, tag1, tag2);
<span class="lineNum">     157 </span>            :         }
<span class="lineNum">     158 </span>            : 
<span class="lineNum">     159 </span>            :     } // namespace range_detail
<span class="lineNum">     160 </span>            : 
<span class="lineNum">     161 </span>            :     namespace range
<span class="lineNum">     162 </span>            :     {
<span class="lineNum">     163 </span>            : 
<span class="lineNum">     164 </span>            :         /// \brief template function equal
<span class="lineNum">     165 </span>            :         ///
<span class="lineNum">     166 </span>            :         /// range-based version of the equal std algorithm
<span class="lineNum">     167 </span>            :         ///
<span class="lineNum">     168 </span>            :         /// \pre SinglePassRange1 is a model of the SinglePassRangeConcept
<span class="lineNum">     169 </span>            :         /// \pre SinglePassRange2 is a model of the SinglePassRangeConcept
<a name="170"><span class="lineNum">     170 </span>            :         /// \pre BinaryPredicate is a model of the BinaryPredicateConcept</a>
<span class="lineNum">     171 </span>            :         template&lt; class SinglePassRange1, class SinglePassRange2 &gt;
<span class="lineNum">     172 </span><span class="lineNoCov">          0 :         inline bool equal( const SinglePassRange1&amp; rng1, const SinglePassRange2&amp; rng2 )</span>
<span class="lineNum">     173 </span>            :         {
<span class="lineNum">     174 </span>            :             BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept&lt;const SinglePassRange1&gt; ));
<span class="lineNum">     175 </span>            :             BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept&lt;const SinglePassRange2&gt; ));
<span class="lineNum">     176 </span>            : 
<span class="lineNum">     177 </span>            :             return ::boost::range_detail::equal(
<span class="lineNum">     178 </span>            :                 ::boost::begin(rng1), ::boost::end(rng1),
<span class="lineNum">     179 </span><span class="lineNoCov">          0 :                 ::boost::begin(rng2), ::boost::end(rng2) );</span>
<span class="lineNum">     180 </span>            :         }
<span class="lineNum">     181 </span>            : 
<span class="lineNum">     182 </span>            :         /// \overload
<span class="lineNum">     183 </span>            :         template&lt; class SinglePassRange1, class SinglePassRange2, class BinaryPredicate &gt;
<span class="lineNum">     184 </span>            :         inline bool equal( const SinglePassRange1&amp; rng1, const SinglePassRange2&amp; rng2,
<span class="lineNum">     185 </span>            :                            BinaryPredicate pred )
<span class="lineNum">     186 </span>            :         {
<span class="lineNum">     187 </span>            :             BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept&lt;const SinglePassRange1&gt; ));
<span class="lineNum">     188 </span>            :             BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept&lt;const SinglePassRange2&gt; ));
<span class="lineNum">     189 </span>            : 
<span class="lineNum">     190 </span>            :             return ::boost::range_detail::equal(
<span class="lineNum">     191 </span>            :                 ::boost::begin(rng1), ::boost::end(rng1),
<span class="lineNum">     192 </span>            :                 ::boost::begin(rng2), ::boost::end(rng2),
<span class="lineNum">     193 </span>            :                 pred);
<span class="lineNum">     194 </span>            :         }
<span class="lineNum">     195 </span>            : 
<span class="lineNum">     196 </span>            :     } // namespace range
<span class="lineNum">     197 </span>            :     using ::boost::range::equal;
<span class="lineNum">     198 </span>            : } // namespace boost
<span class="lineNum">     199 </span>            : 
<span class="lineNum">     200 </span>            : #endif // include guard
</pre>
      </td>
    </tr>
  </table>
  <br>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="ruler"><img src="../../../../../glass.png" width=3 height=3 alt=""></td></tr>
    <tr><td class="versionInfo">Generated by: <a href="http://ltp.sourceforge.net/coverage/lcov.php" target="_parent">LCOV version 1.12</a></td></tr>
  </table>
  <br>

</body>
</html>
